package edu.yuhf.streamdemo;

import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class BuildStream {

    public void ofOperation(){
        Stream<String> stream = Stream.of("git","github.com","gitee.com","java","javascript","python");
        stream.skip(1)
                .filter(value->value.indexOf(".")==-1)
                .map(value->value.toUpperCase())
                .forEach(System.out::println);
    }

    public void filterFunction(){
        List<String> list = List.of("ok","hello","test","javascript","java");
        //list.stream().filter(value->value.startsWith("j")).forEach(System.out::println);
        List<String> list0 = list.stream().filter(value->value.startsWith("j")).collect(Collectors.toList());
        list0.stream().forEach(System.out::println);
    }
}
